import Vue from 'vue'
import VueRouter from 'vue-router'

import MemberLogin from "../views/member/member/MemberLogin";
import MemberRegister from "../views/member/member/MemberRegister";
import MemberHome from "../views/MemberHome";
import BookDetaileList from '../views/member/order/BookDetaileList'


import StaffLogin from "../views/staffMember/staff/StaffLogin";
import StaffHome from "../views/StaffHome";
import MemberList from "../views/staffMember/staff/MemberList";
import StaffMemberList from "../views/staffMember/staff/StaffMemberList";

import ShopList from '../views/staffMember/shop/ShopList'

import BookList from '../views/staffMember/book/BookList'
import AddBook from '../views/staffMember/book/AddBook'
import UpdateBook from '../views/staffMember/book/UpdateBook'
import TypeList from '../views/staffMember/book/TypeList'

import OrderRecordList from '../views/member/order/OrderRecordList'
import ShoppingCartList from '../views/member/order/ShoppingCartList'
import PayRecordList from '../views/member/order/PayRecordList'

import editReplenishmentTask from '../views/staffMember/replenishment/editReplenishmentTask'
import entryBookSingle from '../views/staffMember/replenishment/entryBookSingle'
import getReplenishmentRecord from '../views/staffMember/replenishment/getReplenishmentRecord'
import getReplenishmentTaskByNoFinish from '../views/staffMember/replenishment/getReplenishmentTaskByNoFinish'
import getReplenishmentTaskByFinish from '../views/staffMember/replenishment/getReplenishmentTaskByFinish'
import getReplenishmentTask from '../views/staffMember/replenishment/getReplenishmentTask'

import markInventoryTask from '../views/staffMember/inventory/markInventoryTask'
import getInventoryTask from '../views/staffMember/inventory/getInventoryTask'
import getInventoryTaskByNoFinish from '../views/staffMember/inventory/getInventoryTaskByNoFinish'
import getInventoryTaskByFinish from '../views/staffMember/inventory/getInventoryTaskByFinish'
import findInventoryRecordList from '../views/staffMember/inventory/findInventoryRecordList'
import MemberUpdate from "../views/member/member/MemberUpdate";

Vue.use(VueRouter)

const routes = [
    {path: '/',redirect:'/memberLogin'},
    {path:'/memberLogin',component:MemberLogin},
    {path:'/memberRegister',component:MemberRegister},
    {path:'/memberHome',component:MemberHome,children:[
            {path: '/memberUpdate',name: 'MemberUpdate',component: MemberUpdate},

            {path: '/bookDetaileList',name: 'BookDetaileList',component: BookDetaileList},

            {path: '/orderRecordList',name: 'OrderRecordList',component: OrderRecordList},
            {path: '/shoppingCartList',name: 'ShoppingCartList',component: ShoppingCartList},
            {path: '/payRecordList',name: 'PayRecordList',component: PayRecordList },
            ]},

    {path: '/staff',redirect:'/staffLogin'},
    {path:'/staffLogin',component:StaffLogin},
    {path:'/staffHome',component:StaffHome,children:[
            {path: '/memberList',name: 'MemberList',component: MemberList},
            {path: '/staffMemberList',name: 'staffMemberList',component: StaffMemberList},

            { path: '/shopList', name: 'shopList', component: ShopList },

            {path:'/bookList',name:'BookList',component:BookList },
            {path:'/addBook',name:'AddBook',component:AddBook },
            {path:'/updateBook',name:'UpdateBook',component:UpdateBook },
            {path:'/typeList',name:'TypeList',component:TypeList },

            {name:'发布补货任务',path:'/editReplenishmentTask',component:editReplenishmentTask},
            {name:'录入单品信息',path:'/entryBookSingle',component:entryBookSingle},
            {name:'录入单品信息',path:'/entryBookSingle/:id/:bookDetailedCode',component:entryBookSingle},
            {name:'查询补货记录',path:'/getReplenishmentRecord',component:getReplenishmentRecord},
            {name:'查询全部未完成的补货任务',path:'/getReplenishmentTaskByNoFinish',component:getReplenishmentTaskByNoFinish},
            {name:'查询全部已完成的补货任务',path:'/getReplenishmentTaskByFinish',component:getReplenishmentTaskByFinish},
            {name:'查询全部补货任务',path:'/getReplenishmentTask',component:getReplenishmentTask},

            {name:'发布盘点任务',path:'/markInventoryTask',component:markInventoryTask},
            {name:'查询全部盘点任务',path:'/getInventoryTask',component:getInventoryTask},
            {name:'查询全部未完成的盘点任务',path:'/getInventoryTaskByNoFinish',component:getInventoryTaskByNoFinish},
            {name:'查询全部已完成的盘点任务',path:'/getInventoryTaskByFinish',component:getInventoryTaskByFinish},
            {name:'查询盘点记录',path:'/findInventoryRecordList',component:findInventoryRecordList}
        ]}
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
